package vip.meeet.jdk.mem;

/**
 * -Xss128k
 */
public class JavaVMSOF {

    private int stackDeepth = 1;

    /**
     * 递归深度深和创建大量线程都可能导致堆栈溢出
     */
    private void stackOverflowError(){
        stackDeepth++;
        stackOverflowError();
    }

    public static void main(String[] args) {
        JavaVMSOF instance = new JavaVMSOF();
        try{
            instance.stackOverflowError();
        }finally {
            System.out.println(instance.stackDeepth);
        }
    }
}
